<?php

namespace app\admin\model\resume;

use think\Model;


class Careerobjective extends Model
{

    protected $name = 'resume_career_objective';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'datetime';
    protected $dateFormat = 'Y-m-d H:i:s';

    // 定义时间戳字段名
    protected $createTime = 'CreatedTime';
    protected $updateTime = 'UpdatedTime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'AccommodationRequired_text',
        'AvailabilityDay_text'
    ];



    public function getAccommodationrequiredList()
    {
        return ['1' => __('Accommodationrequired 1'), '0' => __('Accommodationrequired 0')];
    }

    public function getAvailabilitydayList()
    {
        return ['7' => __('Availabilityday 7'), '14' => __('Availabilityday 14'), '30' => __('Availabilityday 30'), '60' => __('Availabilityday 60'), '90' => __('Availabilityday 90'), '255' => __('Availabilityday 255')];
    }


    public function getAccommodationrequiredTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['AccommodationRequired']) ? $data['AccommodationRequired'] : '');
        $list = $this->getAccommodationrequiredList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getAvailabilitydayTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['AvailabilityDay']) ? $data['AvailabilityDay'] : '');
        $list = $this->getAvailabilitydayList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
